package com.hstcs.creator;

import com.badlogic.ashley.core.Entity;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.hstcs.assets.Assets;
import com.hstcs.assets.Config;
import com.hstcs.assets.FileName;
import com.hstcs.components.BackgroundComponent;
import com.hstcs.components.TextureComponent;
import com.hstcs.components.TransformComponent;
import com.hstcs.game.God;

public class BgCreator implements EntityCreator {
	static public void create(){
		
		Entity entity = new Entity();
        BackgroundComponent background = new BackgroundComponent();
        TransformComponent position = new TransformComponent();
        TextureComponent  texture = new TextureComponent();
        
        
        TextureRegion region = new TextureRegion(Assets.getRegion(FileName._BG_GAME));
     //   region.flip(true, true);
 
        
        
        
        texture.region = region;
        position.pos.set(Config._WIDTH/2, Config._HEIGHT/2 , 0f);
        position.scale.set(Config._WIDTH/region.getRegionWidth(), 
        		Config._HEIGHT/region.getRegionHeight());

        entity.add(background);
        entity.add(position);
        entity.add(texture);

        God.instance.engine.addEntity(entity);

	}
}
